package com.example.keli.ui.my.commission;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

import com.example.keli.R;
import com.example.keli.base.BaseActivity;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * description 修改支付宝
 * created by jerry on 2019/3/18.
 */
public class AlipayEditActivity extends BaseActivity {

    @BindView(R.id.et_name)
    EditText etName;
    @BindView(R.id.et_count)
    EditText etCount;

    @Override
    protected int layoutId() {
        return R.layout.activity_edit_alipay;
    }

    @Override
    protected void bindData() {
//        setTitle("修改支付宝");
        abTitle.setText("修改支付宝");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

    }

    @OnClick(R.id.tv_edit)
    public void onViewClicked() {
        String count = etCount.getText().toString().trim();
        String name = etName.getText().toString().trim();
        if (TextUtils.isEmpty(count)){
            toast("请输入账号");
            return;
        }
        if (TextUtils.isEmpty(name)){
            toast("请输入姓名");
            return;
        }
        Intent intent = new Intent();
        //把返回数据存入Intent
        intent.putExtra("alipay_count", count);
        intent.putExtra("alipay_name", name);
        //设置返回数据
        setResult(RESULT_OK, intent);
        finish();
//        EventBus.getDefault().post("");
    }
}
